﻿namespace 六
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入两个数字");
            int a, b;
            a = Convert.ToInt32(Console.ReadLine());
            b = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("最大公约数为" + gcd(a, b));
            Console.WriteLine("最小公倍数为" + (a * b) / gcd(a, b));
        }
        static int gcd(int a,int b)
        {
            if(b==0)
            {
                return a;
            }
            else
            {
                return gcd(b, a % b);
            }
        }
    }
}
